//StringBuilder构造方法
//StringBuilder的添加和反转
package text;

import com.sun.org.apache.xerces.internal.util.SynchronizedSymbolTable;

import java.util.Scanner;
import java.util.stream.StreamSupport;

public class StudentDemo {
    public static void main(String[] args) {
        StringBuilder sb = new StringBuilder();

//        public StringBuilder append(任意类型)：添加数据，并返回对象本身

//        StringBuilder sb2 = sb.append("hello");
//        System.out.println("sb:" + sb);
//        System.out.println("sb2:"+sb2);
//        System.out.println(sb==sb2);

//        sb.append("hello");
//        sb.append("world");
//        sb.append("JAVA");
//        System.out.println("sb:"+sb);

//        链式编程
        sb.append("hello").append("world").append("JAVA").append("100");
        System.out.println("sb:" + sb);

//        public StringBuilder reverse 返回相反的字符序列
        sb.reverse();
        System.out.println("sb:" + sb);
    }
}
